// loading 组件的封装
import React, { Component } from 'react';
// 引入loading 组件
import { Spin } from 'antd';
// 引入 css-in-js库
import styled from 'styled-components'
class Loading extends Component {

    // 设置默认属性
    static defaultProps = {
        spinning: true,
        tip: '加载中'
    }
    render() {

        return (
            <Main>
                <Spin size='large' spinning={this.props.spinning} tip={this.props.tip}></Spin >
            </Main>
        );
    }
}

const Main = styled.div`
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
`

export default Loading;
